import request from '@/utils/requst';
const teachers = {
  //获取
  get(params) {
    return request({
      url: "/teachers/getTeachers",
      method: "GET",
      params: params, //只有在请求数据的时候才用params，前面params是固定的，后面的params是形参
    });
  },
  //增加
  add(data) {
    return request({
      url: "/teachers/addTeachers",
      method: "POST",
      data: data, //前面data是固定的，后面的data是形参
    });
  },

  //删除一个老师数据
  delete(data) {
    return request({
      url: "/teachers/deleteTeachers",
      method: "DELETE",
      data: data,
    });
  },
 
 //修改老师
 update(data) {
    return request({
        url:'/teachers/updateTeachers',
        method: 'PUT',
        data:data
    })
},
 //获取一个老师数据
 getById(params){
    return request({
        url: '/teachers/getTeachersById',
        method: 'GET',
        params: params//前面data是固定的，后面的data是形参
         })
},
};
export default teachers;
